@extends('layout')
@section('content')
<div class="panel panel-warning">
      <div class="panel-heading">
      <h3><left><a href = "/grupos"><a class="glyphicon glyphicon-th-list text-warning"></a></left>Lista de Ganados Asociados a Grupos </h3>
      </div>
    </div>
      <div class="panel-body">
        <table class="table table-hover">
        <thead>
          <tr>
            <Th> ID GRUPO</ th>
            <Th> COD GRUPO</ th>
               <Th> COD Ganado </ th>              
                <Th> Estado </ th>
                  <th>Acciones</th>            
        </thead>
        <tbody>
          @foreach($grupo as $group)
            <tr>
            <td> {{$group->id}} </td> 
            <td>
                @foreach($var2 as $var)
                @if($group->id_ganado == $var->cod_grupo)
                 {{$var->cod_grupo}} 
                  @endif
                  @endforeach
           </td>

            <td>
            @foreach($ganado as $gan)
                    @if($group->id_ganado == $gan->id)
                    {{$gan->cod_ganado}} 
                    @endif
                  @endforeach
                </td>
                      <td>
            @if ($group->activo == 0) 
                              <p>Inactivo</p> 
                              @else 
                                 <p>  activo</p> 
                                    @endif    </td>  
                                               <td> 
           <a>{{ Form::open(array('url' => 'ganadogrupo/'.$group->id, 'method'=> 'delete')) }}
               {{ Form::submit('Desasociar',  array('class' => "btn btn-warning"))}}
               {{ Form::close() }}</a>
                 </td>          
                     </tr>
          @endforeach
                </tbody>
      </table>
    {{$grupo->links()}}       
      </div>
      <div>
        <a href="{{URL::to('grupos')}}"><button type="submit" class="btn btn-warning"> Regresar</button></a> 
    </div>
    </div>
@stop